<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>系统配置</title>
    <meta name="keywords" content="系统配置">
    <meta name="description" content="系统配置">
    <link rel="shortcut icon" href="favicon.ico">
    <link href="__ADMIN__/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="__ADMIN__/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="__ADMIN__/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="__ADMIN__/css/animate.min.css" rel="stylesheet">
    <link href="__ADMIN__/css/style.min862f.css?v=4.1.0" rel="stylesheet">
    <script src="__ADMIN__/js/jquery.min.js?v=2.1.4"></script>
    <script src="__ADMIN__/js/ajaxfileupload.js"></script>
    <link href="__ADMIN__/css/admin.css" rel="stylesheet">
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeIn">
        <div class="row">
            <div class="col-sm-12">
                <div class="tabs-container">
                    <div class="tab-content">
                        <div class="panel-body">
                            <form method="post" class="form-horizontal" action="{:url('edit')}" data-type="ajax">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">缓存时间(秒)</label>
                                    <div class="col-sm-10">
                                        <input type="text" name='cachetime' class="form-control" value="{$config.cachetime}">
                                    </div>
                                </div>
                                <div class="hr-line-dashed"></div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label">是否开启图片水印</label>
                                    <div class="col-sm-10">
                                        <div class="radio i-checks">
                                            <label><input type="radio" value="1" name="watermarkenable" {eq name="config.watermarkenable" value="1"}checked{/eq}><i></i> 是</label>
                                            <label><input type="radio" value="0" name="watermarkenable" {eq name="config.watermarkenable" value="0"}checked{/eq}><i></i> 否</label>
                                        </div>
                                    </div>
                                </div>
                                <div class="hr-line-dashed"></div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label">图片水印地址</label>
                                    <div class="col-sm-10">
                                        <div id="file-pretty">
                                            <input id="file_path" name="file" type="file" class="form-control" style="display:none">
                                            <div class="input-append input-group">
                                                <span class="input-group-btn">
                                                    <button id="btn_path" type="button" class="btn btn-white">选择图片</button>
                                                </span>
                                                <input id="info_path" type="text" name='watermarkurl' class="form-control input-large" value="{$config.watermarkurl}">
                                            </div>
                                            <span class="help-block m-b-none">未开启图片水印无需上传</span>
                                        </div>
                                        <script type="text/javascript">
                                            $(function(){
                                                $('#btn_path').click(function(){
                                                    $("#file_path").click();
                                                });

                                                //异步上传
                                                $("body").delegate("#file_path", 'change', function(){
                                                    var filepath = $("input[name='file']").val();
                                                    var arr = filepath.split('.');
                                                    var ext = arr[arr.length-1];//图片后缀

                                                    if('png'.indexOf(ext)>=0){
                                                        $.ajaxFileUpload({
                                                           url: '{:url('upload_image')}',
                                                           type: 'post',
                                                           data: { name: 'file' },
                                                           secureuri: false,
                                                           fileElementId: 'file_path',
                                                           dataType: 'json',
                                                           success: function (data, status) {
                                                               $('#info_path').val(data);
                                                               $('#info_path').focus();
                                                           },
                                                           error: function (data, status, e){
                                                               layer.alert('上传失败');
                                                           }
                                                        });
                                                    }else{
                                                        // 清空file
                                                        $('#file_path').val('');
                                                        layer.alert('请上传png图片格式');
                                                    }
                                                });
                                            });
                                        </script>
                                    </div>
                                </div>
                                <div class="hr-line-dashed"></div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label">是否开启分销功能</label>
                                    <div class="col-sm-10">
                                        <div class="radio i-checks">
                                            <label><input type="radio" value="1" name="distribute_open" {eq name="config.distribute_open" value="1"}checked{/eq}><i></i> 开启</label>
                                            <label><input type="radio" value="0" name="distribute_open" {eq name="config.distribute_open" value="0"}checked{/eq}><i></i> 关闭</label>
                                        </div>
                                    </div>
                                </div>
                                <div class="hr-line-dashed"></div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label">分销层级</label>
                                    <div class="col-sm-10">
                                        <div class="radio i-checks">
                                            <label><input type="radio" value="1" name="distribute_level" {eq name="config.distribute_level" value="1"}checked{/eq}><i></i> 一级分销</label>
                                            <label><input type="radio" value="2" name="distribute_level" {eq name="config.distribute_level" value="2"}checked{/eq}><i></i> 二级分销</label>
                                            <label><input type="radio" value="3" name="distribute_level" {eq name="config.distribute_level" value="3"}checked{/eq}><i></i> 三级分销</label>
                                        </div>
                                    </div>
                                </div>
                                <div class="hr-line-dashed"></div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label">一级分销佣金比例(%)</label>
                                    <div class="col-sm-10">
                                        <input type="text" name='first_rate' class="form-control" value="{$config.first_rate}">
                                    </div>
                                </div>
                                <div class="hr-line-dashed"></div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label">二级分销佣金比例(%)</label>
                                    <div class="col-sm-10">
                                        <input type="text" name='second_rate' class="form-control" value="{$config.second_rate}">
                                    </div>
                                </div>
                                <div class="hr-line-dashed"></div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label">三级分销佣金比例(%)</label>
                                    <div class="col-sm-10">
                                        <input type="text" name='third_rate' class="form-control" value="{$config.third_rate}">
                                    </div>
                                </div>
                                <div class="hr-line-dashed"></div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label">最低提现额度</label>
                                    <div class="col-sm-10">
                                        <input type="text" name='limit' class="form-control" value="{$config.limit}">
                                    </div>
                                </div>
                                <div class="hr-line-dashed"></div>

                                <div class="form-group">
                                    <div class="col-sm-4 col-sm-offset-2">
                                        <button class="btn btn-primary" type="submit">提交</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script src="__ADMIN__/js/bootstrap.min.js?v=3.3.6"></script>
    <script src="__ADMIN__/js/content.min.js?v=1.0.0"></script>
    <script src="__ADMIN__/js/plugins/iCheck/icheck.min.js"></script>
    <script src="__ADMIN__/js/plugins/layer/layer.min.js"></script>
    <script src="__ADMIN__/js/layer_hplus.js"></script>
    <script src="__ADMIN__/js/plugins/prettyfile/bootstrap-prettyfile.js"></script>
    <script src="__ADMIN__/js/plugins/cropper/cropper.min.js"></script>
    <!-- <script src="__ADMIN__/js/demo/form-advanced-demo.min.js"></script> -->
    <script src="__ADMIN__/js/plugins/layer/laydate/laydate.js"></script>
</body>

</html>
